ostadmin: Fix up deploy config logic again
authorColin Walters <walters@verbum.org>
Sun, 9 Sep 2012 15:42:17 +0000 (11:42 -0400)
committerColin Walters <walters@verbum.org>
Sun, 9 Sep 2012 15:42:17 +0000 (11:42 -0400)
Clearly we need tests here...

src/ostree/ot-admin-builtin-deploy.c

index f81404f786fe1260ba63c49050c64df78b939f96..2041c5f203bb8d35b9e2cdca38aa6b42608603b9 100644 (file)
@@ -204,10 +204,9 @@ copy_one_config_file (OtAdminDeploy      *self,
   ot_lobj GFile *dest = NULL;
   ot_lobj GFile *parent = NULL;
   ot_lfree char *relative_path = NULL;
-  ot_lobj GFile *modified_path = NULL;
   
-  relative_path = g_file_get_relative_path (orig_etc, src);
-  modified_path = g_file_resolve_relative_path (modified_etc, relative_path);
+  relative_path = g_file_get_relative_path (modified_etc, src);
+  g_assert (relative_path);
   dest = g_file_resolve_relative_path (new_etc, relative_path);
 
   parent = g_file_get_parent (dest);
@@ -288,15 +287,8 @@ merge_etc_changes (OtAdminDeploy  *self,
   for (i = 0; i < modified->len; i++)
     {
       OstreeDiffItem *diff = modified->pdata[i];
-      ot_lfree char *relative_path = NULL;
-      ot_lobj GFile *modified_path = NULL;
-      ot_lobj GFile *target_path = NULL;
-      
-      relative_path = g_file_get_relative_path (orig_etc, diff->src);
-      modified_path = g_file_resolve_relative_path (modified_etc, relative_path);
-      target_path = g_file_resolve_relative_path (new_etc, relative_path);
-
-      if (!copy_one_config_file (self, orig_etc, modified_etc, new_etc, diff->src,
+
+      if (!copy_one_config_file (self, orig_etc, modified_etc, new_etc, diff->target,
                                  cancellable, error))
         goto out;
     }